Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MultipleLanguages): Delete translations when components are deleted #1756

Conversation

hirokiterashima
Copy link
Member

Changes

  • Delete translations associated with deleted components. Note: to keep the review scope small, I didn't implement deleting translations associated with deleted nodes in this PR.

Test

  • Multilingual unit:
    • Associated translation entries are deleted from translations.[language].json files (for all supported languages) when you delete one component and when you delete multiple components.
  • Non-multilingual unit:
    • Deleting component(s) work as before

@hirokiterashima hirokiterashima self-assigned this Apr 25, 2024
@hirokiterashima hirokiterashima marked this pull request as ready for review April 25, 2024 18:36
Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting one component seems to work but deleting multiple components at the same time does not delete all the translations that should be deleted. If a translation save request is made for each component that is deleted, it leads to a race condition since it saves all the translations in each request.

@hirokiterashima
Copy link
Member Author

Good catch. I've changed the service function to handle removing multiple components' translations at at time to prevent overwriting. PTAL

Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hirokiterashima hirokiterashima merged commit 371e84f into issue-1513-multiple-languages-per-unit Apr 29, 2024
@hirokiterashima hirokiterashima deleted the multiple-languages-delete-component-translations branch April 29, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants